"""
手机类型页面
点击购买诺基亚N85方法
"""
from common.base import Base, get_driver
from selenium.webdriver.common.by import By


class PhoneTypePage(Base):
    # 点击购买诺基亚N85
    def click_n85(self):
        self.click((By.XPATH, '//a[@href="goods.php?id=32"]'))


if __name__ == '__main__':
    # 创建浏览器驱动
    driver = get_driver()
    phone_type = PhoneTypePage(driver)
    # 访问目标网址
    phone_type.get('http://localhost:8080/ecshop/category.php?id=1')
    phone_type.click_n85()
    phone_type.quit(2)

